<?php

/**
 * Observation form.
 *
 * @package    Redsea20
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ObservationForm extends BaseObservationForm {

    public function configure() {
        $this->useFields(array('location', 'lat', 'lng', 'remarks', 'researchid',
            'observationdate', 'created_at', 'updated_at'));

        $this->widgetSchema['location'] = new sfWidgetFormInputText();
        $this->widgetSchema['remarks'] = new sfWidgetFormInputText();
        $this->widgetSchema['researchid'] = new sfWidgetFormInputHidden();
        $this->widgetSchema['created_at'] = new sfWidgetFormInputHidden();
        $this->widgetSchema['updated_at'] = new sfWidgetFormInputHidden();
        $this->widgetSchema['observationdate'] = new sfWidgetFormInputText();

        $this->validatorSchema['researchid'] = new sfValidatorInteger(array('required' => false));
        $this->validatorSchema['observationdate'] = new sfValidatorDate(array('required' => false));
        $this->validatorSchema['created_at'] = new sfValidatorDateTime(array('required' => false));
        $this->validatorSchema['updated_at'] = new sfValidatorDateTime(array('required' => false));

        $this->validatorSchema['researchid']->setMessage('required', 'research id required');
        $this->validatorSchema['observationdate']->setMessage('required', 'observation date required');
        $this->validatorSchema['created_at']->setMessage('required', 'created at required');
        $this->validatorSchema['updated_at']->setMessage('required', 'updated at required');
    }

}
